package com.umerclass.frame.ui.adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import java.util.List;

public class TabFragmentPagerAdapter extends FragmentPagerAdapter {
    private FragmentManager fm;
    private List<Fragment> fragments;

    public TabFragmentPagerAdapter(FragmentManager fm, List<Fragment> list) {
        super(fm);
        this.fm = fm;
        this.fragments = list;
    }

    @Override
    public Fragment getItem(int arg0) {
        return fragments.get(arg0);//显示第几个页面
    }

    @Override
    public int getCount() {
        return fragments.size();//有几个页面
    }
}